@minH: 72px;
@space: 10px 12px;
@borderColor: #e9e9e9;
@actions-w: 44px;
@fixed-col-w: 38px;
@fixed-col-border-w: 1px;
@fixed-left-space: @fixed-col-w + @fixed-col-border-w;
@title-bg: #f7f7f7;

.wea-edc-datatable-wrapper {
  position: relative;
  overflow-y: hidden;
  overflow-x: auto;
  z-index: 1;

  &::-webkit-scrollbar {
    height: 10px;
  }
  &::-webkit-scrollbar-thumb {
    background: #ccc;
  }

  .wea-edc-com-title {
    background: @title-bg;
    border-bottom: 1px solid @borderColor;
  }
}

.wea-edc-datatable-content {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  z-index: 1;
  
  &.empty {
    .wea-edc-com-title + * {
      display: none !important;
    }
  }
  &.resizing {
    .wea-edc-dragging {
      height: 100%;
      border: inherit !important;

      & > * {
        visibility: visible;
      }

      &.sortable-drag {
        display: none;
      }
    }
  }
  &.covered:not(.resizing) {
    .wea-edc-datatable-item > div:last-child,
    .wea-edc-datatable-col:last-child > div {
      border-right: none;
    }
  }  
  & > div {
    &:first-child {
      border-right-color: @borderColor;
    }
  }

  .wea-edc-datatable-item {
    position: relative;
    white-space: nowrap;
    border-bottom: 1px solid @borderColor;
    display: block;
    width: 100%;
    height: 100%;
    
    &:last-child {
      border-bottom: none;
    }
    & > div {
      overflow: hidden;
      .wea-edc-datatable-col();
    }
    .wea-edc-form-item {
      border: none;
      padding: 0px;
    }
    .wea-edc-form-select {
      .ant-radio-group {
        white-space: normal;
        overflow: auto;
      }
    }
  }

  .wea-edc-datatable-col {
    position: relative;
    display: inline-block;
    vertical-align: top;
    height: 100%;
    border-bottom: 1px solid @borderColor;

    &:hover .action-group {
      display: block;
    }
  }
  .wea-edc-form-item {
    & > div {
      padding-bottom: 0 !important;
    }
  }
}

.wea-edc-datatable-item {
  & > div > div:first-child {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-right: 1px solid @borderColor;
  }
}

.wea-edc-fb-com {
  .wea-edc-datatable-content,
  .wea-edc-datatable-item {
    min-height: @minH;
  }
}

.wea-edc-form-datatable {
  .ant-table {
    table {
      table-layout: fixed;
    }
    .ant-table-body {
      // 用于覆盖ant-table 设置固定高度后右侧出现滚动条轨道，影响宽度计算问题
      overflow: auto !important; 
    }
    .ant-table-tbody .wea-edc-com-title {
      display: none;
    }
    .ant-table-tbody td {
      overflow: auto;
    }
    .ant-table-header {
      &::-webkit-scrollbar {
        height: 0px;
      }
      &::-webkit-scrollbar-thumb {
        background: #f7f7f7;
      }
    }
    .wea-edc-form-item,
    .ant-table-thead > tr > th,
    .ant-table-tbody > tr > td {
      padding: 0;
    }
    .ant-table-thead > tr > th {
      font-weight: normal;
      border-bottom: 1px solid @borderColor;
    }
    .wea-edc-form-item > div {
      padding-bottom: 5px !important;
    }
    .ant-table-thead > tr > th,
    .ant-table-tbody > tr > td {
      vertical-align: top;
      border-right: 1px solid @borderColor;
    }
    .ant-table-thead,
    .ant-table-tbody {
      & > tr > .ant-table-selection-column {
        vertical-align: middle;
      }
    }
  }
  .wea-edc-form-combobox {
    & > .wea-input-normal {
      margin-top: -18px;
    }
  }
  .wea-edc-datatable-fixed-left {
    display: inline-flex;
    flex-direction: column;
    left: 0;
    top: 0;
    bottom: 0;
    border-right: @fixed-col-border-w solid @borderColor;
    background: #fff;

    .wea-edc-com-title {
      & > div,
      & + div {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
      }
      & > div {
        height: 100%;
      }
      & + div {
        flex: 1;
        border-bottom: 1px solid @borderColor;
      }
    }
  }

  .wea-edc-datatable-content {
    border-left: none;
  }
  .wea-edc-title-extra {
    float: right;
    color: #57c5f7;
    cursor: pointer;
    padding-right: 1px;
    transition: opacity ease-in-out 225ms;

    span {
      padding-right: 5px;

      &:hover {
        opacity: .7;
      }
      &:last-child {
        padding-right: 0;
      }
    }
    i { 
      font-weight: bolder;
      color: #57c5f7;
      padding-right: 1px;
      transform: scale(0.8);
    }
    .delete,
    .delete i {
      color: #e67575;
    }
  }

  .wea-edc-com-readonly {
    background: #fff0;
    .ant-table {
      border-left: 1px solid #e9e9e9;
      .wea-edc-com-readonly{
        padding-left: 20px;
      }
    }
  }
}

.f-datatable {
  .wea-edc-fb-com {
    background: #fff;

    &:hover .action-btns {
      display: none;
    }
  }
  .wea-edc-com-title + div {
    .wea-edc-form-item {
      padding-right: 0;
    }
    .wea-edc-com-title,
    .wea-edc-com-title+div,
    .wea-edc-com-title+span,
    .wea-edc-com-title+label,
    .wea-edc-com-title+div+div {
      padding-right: 12px;
    }
    .wea-view-textarea {
      .wea-textarea-tips {
        right: 20px;
      }
    }
  }
  .wea-edc-com,
  .wea-edc-fb-com,
  .wea-edc-form-item,
  .wea-edc-datatable-col > div:first-child {
    height: 100% !important;
  }
  .wea-edc-form-item {
    .wea-edc-com-title {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
  .wea-edc-form-item:hover .action-group {
    display: none;
  }
}

.resizable-handle-wrapper {
  & > div {
    width: 15px !important;
    height: auto !important;
    bottom: 0;
    z-index: 1;
  }
}

.mobile-device {
  .wea-edc-form-datatable {
    .wea-edc-form-date .wea-edc-com-title + div:after,
    .wea-edc-form-time .wea-edc-com-title + div:after {
      top: 18px;
    }
    .wea-edc-com-title + .wea-edc-select-container:after {
      top: 26px;
    }
  }
}
.mobile-mask{
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0,0,0,.5);
  z-index: 10;
}
.mobile-row{
  position: fixed;
  width: 100%;
  bottom: -100%;
  right: 0;
  background-color: #f7f7f7;
  z-index: 11;
  height: 80%;
  transition: bottom 0.3s ease 0s;
}
.all-height{
 bottom: 0;
}
.mobile-row .mobile-row-main{
  height: calc(100% - 45px);
  overflow-y: auto;
}
.mobile-row-btns{
  position: relative;
  display: flex;
  background-color: #fff;
  height: 45px;
}
.mobile-row .mobile-row-btns:before{
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #d9d9d9;
  -webkit-transform: scaleY(0.5);
  transform: scaleY(0.5);
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}
.mobile-row-btns .row-btn{
  flex: 1;
  text-align: center;
  position: relative;
  line-height: 45px;
  font-size: 16px;
  color: #666;
}
.mobile-row-btns .row-btn:after{
  position: absolute;
  content: '';
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: #ddd;
  -webkit-transform: scaleX(0.5);
  transform: scaleX(0.5);
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}
.c-blue{
  color: #0090d1!important;
}
.mobile-row .wea-edc-form-item{
  padding-left: 10px;
}
 .wea-edc-fv-wrapper.mobile-device .mobile-row .wea-edc-form-item{
  padding-left: 15px;
  padding-right: 25px;
}
.mobile-row {
  .wea-edc-com-title,
  .wea-edc-com-title + div{
      padding: 10px 0 0 12px !important;
    } 
}
.wea-edc-wrapper-com .mobile-row {
  .wea-edc-has-error {
    .wea-edc-errmsg{
      margin-top: 0;
    }
  }
}
.mobile_hidden{
  overflow: hidden;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
}
.wea-edc-form-datatable {
  .ant-table-body tr {
    .wea-edc-com-readonly {
      margin-left: 0;
      &::after {
        display: none;
      }
    }
  }
  .wea-view-textarea {
    .wea-textarea-tips {
      right: 8px;
      bottom: 22px;
    }
  }
}


